package com.fadadianqi.logistics.inventory.dao.ibatis;

import com.fadadianqi.commons.GenericDAOSuport;
import com.fadadianqi.logistics.inventory.dao.BacktrackItemDAO;
import com.fadadianqi.logistics.inventory.model.BacktrackItem;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Component
public class BacktrackItemDAOImpl extends
        GenericDAOSuport<String, BacktrackItem> implements BacktrackItemDAO {

    @Override
    protected Class<?> getObjectClass() {
        return BacktrackItem.class;
    }

    @Override
    protected String getTableName() {
        return "backtrack_item";
    }

    @Override
    public List<BacktrackItem> findByBacktrackBatchId(String backtrackBatchId) {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("backtrackBatchId", backtrackBatchId);
        return super.findByPropertys(map);
    }

}
